package yang.itcode.controller;

import cn.hutool.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yang.itcode.model.Result;
import yang.itcode.service.ProfitService;

@RestController
@RequestMapping("/api/profit")
public class ProfitController {

    @Autowired
    private ProfitService profitService;

    @PostMapping("/list")
    public Result<JSONObject> getProfitList(@RequestBody JSONObject obj) {
        return Result.success(profitService.getProfitList(obj));
    }

    @PostMapping("/gross/list")
    public Result<JSONObject> getGrossProfitList(@RequestBody JSONObject obj) {
        return Result.success(profitService.getProfitList(obj));
    }
}
